import request from '@/utils/request';

export function getRoles(current, limit) {
  return request({
    url: `/museum-role/role/getAllRole/${current}/${limit}`,
    method: 'get'
  });
}

export function addRole(permissionId, roleName, roleDesc) {
  return request({
    url: '/museum-role/role/addRole',
    method: 'post',
    data: {
      permissionId,
      roleDesc,
      roleName
    }
  });
}

export function deleteRole(roleId) {
  return request({
    url: `/museum-role/role/deleteRole?roleId=${roleId}`,
    method: 'delete'
  });
}

export function updateRole(permissionId, roleId, roleName, roleDesc) {
  return request({
    url: '/museum-role/role/update',
    method: 'put',
    data: {
      permissionId,
      roleId,
      roleName,
      roleDesc
    }
  });
}
